﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="entity.tUser"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	tUser tuser = (tUser) session.getAttribute("user");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>设备-水处理系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>

<script type="text/javascript">
var esilTitle = ["停止","开阀门","关阀门","故障"];
function getDate() {
					jQuery.ajax({
						url : "oftenDeviceAction",
						type : "POST",
						data:{whether:true},
						dataType : "json",
						success : function(date) {
							 var ph=date.ph/1;
							if(parseFloat(ph)>9||parseFloat(ph)<6.8){
								$('#ph').html("<font style='color:red'>"+ph.toFixed(2)+"</font>");
							}else{
								$('#ph').html(ph.toFixed(2));
							}
							var orp=date.orp/1;
							if(parseInt(orp)>300||parseInt(orp)<100){
								$('#orp').html("<font style='color:red'>"+orp.toFixed(2)+"</font>");
							}else{
								$('#orp').html(orp.toFixed(2));
							}
							var temperature=date.temperature/1;
							if(parseInt(temperature)>45||parseInt(temperature)<20){
								$('#temperature').html("<font style='color:red'>"+temperature.toFixed(2)+"</font>");
							}else{
								$('#temperature').html(temperature.toFixed(2));
							}
							var num=date.ec/1;
							if(parseInt(date.ec)>180||parseInt(date.ec)<60){
								$('#ec').html("<font style='color:red'>"+num.toFixed(2)+"</font>");
							}else{
								$('#ec').html(num.toFixed(2));
							}			
							var openEC=date.openEC/1;	
							if(parseInt(openEC)>390||parseInt(openEC)<200){
								$('#openEC').html("<font style='color:red'>"+openEC.toFixed(2)+"</font>");
							}else{
								$('#openEC').html(openEC.toFixed(2));
							}
							var closeEC=date.closeEC/1;
							if(parseInt(closeEC)>1800||parseInt(closeEC)<600){
								$('#closeEC').html("<font style='color:red'>"+closeEC.toFixed(2)+"</font>");
							}else{
								$('#closeEC').html(closeEC.toFixed(2));
							}
							if(date.esil)$('#esil').html(esilTitle[date.esil-0]);
                                                        var numec1=date.ec1/1;
							$('#ec1').html(numec1.toFixed(2));
                                                        var numec2=date.ec2/1;
							$('#ec2').html(numec2.toFixed(2));
                                                        var numec3=date.ec3/1;
							$('#ec3').html(numec3.toFixed(2));
                                                         var numec4=date.ec4/1;
							$('#ec4').html(numec4.toFixed(2));
                                                        var numec5=date.ec5/1;
							$('#ec5').html(numec5.toFixed(2));
                                                        var numec6=date.ec6/1;
							$('#ec6').html(numec6.toFixed(2));
                                                        var numec7=date.ec7/1;
							$('#ec7').html(numec7.toFixed(2));
                                                        var numec8=date.ec8/1;
							$('#ec8').html(numec8.toFixed(2));
                                                         var numec9=date.ec9/1;
							$('#ec9').html(numec9.toFixed(2));
                                                         var numec10=date.ec10/1;
							$('#ec10').html(numec10.toFixed(2));
                                                           var numec11=date.ec11/1;
							$('#ec11').html(numec11.toFixed(2));
                                                        var numec12=date.ec12/1;
							$('#ec12').html(numec12.toFixed(2));
                                                         var numec13=date.ec13/1;
							$('#ec13').html(numec13.toFixed(2));
						}
					  })
        }
        
$(document).ready(function() {
	getDate();
   setInterval("getDate()", 5000);
});
</script>
<script src="js/jquery.carouFredSel-6.0.4-packed.js" type="text/javascript"></script>
	</head>
	<body>
		<div class="main">
			<jsp:include page="conter/header.jsp"></jsp:include>
  <div class="certen">
   <jsp:include page="conter/deviceLeft.jsp"></jsp:include>
			<div class="content">
				<div class="mainbar">
                                        

					<div class="runbutton">
						<h2>
							<span style="color: #fff; margin-left:17px;">运行数据</span>
							<span><a href="searchtAverageDateAction?deviceId=${deviceId}">历史数据</a></span>
						</h2>
						
					</div>
					
					<div class="devicrname">
					<h2>
						<span style="margin-left:10px;">${deviceName}</span>&minus;&minus;&minus;
						<span>${place}</span>
					</h2>	
					</div>
					
					<div class="runphone" style="text-align:center">
						<label>运行示意图  </label>
						<div style="margin-top:18px;"><OBJECT WIDTH="800" HEIGHT="300" ALIGN=center ><PARAM NAME=movie VALUE="images/wtsflash.swf">
<EMBED src="/images/wtsflash.swf" WIDTH="800" HEIGHT="300" NAME="2" ALIGN="center"></EMBED></OBJECT></div>
					</div>
					<div class="rundate" style="text-align:center">
						
						 <div class="m_data">
							<div style="width: 900px"> 
							<ul>
								<s:if test="ph==1">
									<li>
										<span>PH值</span><div  class="d_gbdd" id="ph" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="orp==1">
									<li>
										<span>ORP</span><div class="d_orp" id="orp" style="text-align:center">288</div>
									</li>
								</s:if>
								<s:if test="temperature==1">
									<li>
										<span>温度</span><div class="d_wend" id="temperature" style="text-align:center">38.8</div>
									</li>
								</s:if>
								<s:if test="ec==1">
									<li>
										<span>电导率</span>
										<div class="d_ddl" id="ec" style="text-align:center">888</div>
									</li>
								</s:if>
								<s:if test="openEC==1">
									<li>
										<span>开阀电导率</span>
										<div class="d_kzdd" id="openEC" style="text-align:center">888</div>
									</li>
								</s:if>
								<s:if test="closeEC==1">
									<li>
										<span>关阀电导率</span>
										<div class="d_gbdd" id="closeEC" style="text-align:center">888</div>
									</li>
								</s:if>
								<s:if test="esil==1">
								    <li>
										<span>电动阀指示灯</span>
										<div class="d_gbdd" id="esil" style="text-align:center">ON</div>
									</li>
								</s:if>
								<s:if test="ec1==1">
									<li>
										<span>PA1运行电流</span>
										<div class="d_gbdd" id="ec1" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec2==1">
									<li>
										<span>PA2运行电流</span>
										<div class="d_gbdd" id="ec2" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec3==1">
									<li>
										<span>PA3运行电流</span>
										<div class="d_gbdd" id="ec3" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec4==1">
									<li>
										<span>PA4运行电流</span>
										<div class="d_gbdd" id="ec4" style="text-align:center">8.8</div>
									</li>
								</s:if>
							    <s:if test="ec5==1">
									<li>
										<span>PA5运行电流</span>
										<div class="d_gbdd" id="ec5" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec6==1">
									<li>
										<span>PA6运行电流</span>
										<div class="d_gbdd" id="ec6" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec7==1">
									<li>
										<span>PA7运行电流</span>
										<div class="d_gbdd" id="ec7" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec8==1">
									<li>
										<span>PA8运行电流</span>
										<div class="d_gbdd" id="ec8" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec9==1">
									<li>
										<span>PA9运行电流</span>
										<div class="d_gbdd" id="ec9" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec10==1">
									<li>
										<span>PA10运行电流</span>
										<div class="d_gbdd" id="ec10" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec11==1">
									<li>
										<span>PA11运行电流</span>
										<div class="d_gbdd" id="ec11" style="text-align:center">8.8</div>
									</li>
								</s:if>
								<s:if test="ec12==1">
									<li>
										<span>PA12运行电流</span>
										<div class="d_gbdd" id="ec12" style="text-align:center">8.8</div>
									</li>
							    </s:if>
								<s:if test="ec13==1">
									<li>
										<span>PA13运行电流</span>
										<div class="d_gbdd" id="ec13" style="text-align:center">8.8</div>
									</li>
								</s:if>
								</ul>
							</div>
							</div>
						</div>
						<div class="m_button">
							<s:if test="ph==1">
								<a href="conter/ph.jsp"  target="iframe"  onclick="phvalue()"><img src="images/phz.png" style="width: 128px;height:23px;"/></a>
							</s:if>
							<s:if test="orp==1">
								<a href="conter/ORP.jsp"  target="iframe" onclick="orpcurve()"><img src="images/orp.png" style="width: 128px;height:23px;"/></a>
							</s:if>
							<s:if test="temperature==1">
								<a href="conter/tem.jsp"  target="iframe" onclick="tempera()"><img src="images/wend.png" style="width: 128px;height:23px;"/></a>
							</s:if>
							<s:if test="ec==1">
								<a href="conter/closeec.jsp"  target="iframe" onclick="conductivity()"><img src="images/ddl.png" style="width: 128px;height:23px;"/></a>
							</s:if>
						</div>
						<div class="curve">
							<span id="conductivity" style="display:none">电导率曲线图</span>
							<span id="phvalue" style="display:block">PH值曲线图</span>
							<span id="orpcurve" style="display:none">ORP曲线图</span>
							<span id="tempera" style="display:none">温度曲线图</span>
						</div>
					<div class="o_bottom">
						<div  style="height: 400px; width: 825px;">
							<iframe id="iframe" name="iframe" frameborder="0" scrolling="auto" height="100%" width="100%" src="conter/ph.jsp">
							</iframe> 
						</div>
					</div>
			
			<div class="clr"></div>
		</div>
</div>
		 <div class="fbg">
    <div class="fbg_resize">	  
	<jsp:include page="conter/slide.jsp"></jsp:include>
	</div> 
  </div>
  <jsp:include page="conter/footer.jsp"></jsp:include>
</div>
<script type="text/javascript">
	function conductivity(){
		document.getElementById("conductivity").style.display="block";
		document.getElementById("phvalue").style.display="none";
		document.getElementById("orpcurve").style.display="none";
		document.getElementById("tempera").style.display="none";
}
function phvalue(){ 
		document.getElementById("conductivity").style.display="none";  
		document.getElementById("phvalue").style.display="block";
		document.getElementById("orpcurve").style.display="none";
		document.getElementById("tempera").style.display="none";
}
function orpcurve(){ 
		document.getElementById("conductivity").style.display="none";  
		document.getElementById("phvalue").style.display="none";
		document.getElementById("orpcurve").style.display="block";
		document.getElementById("tempera").style.display="none";
}
function tempera(){ 
		document.getElementById("conductivity").style.display="none";  
		document.getElementById("phvalue").style.display="none";
		document.getElementById("orpcurve").style.display="none";
		document.getElementById("tempera").style.display="block";
}
</script>	

</body>
</html>